package day34;
import java.util.*;

public class A1 {

    //多组输入是有问题的
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        //while (in.hasNextLine()) { // 注意 while 处理多个 case
        char[] s = in.nextLine().toCharArray();
        int sum=0,count=1,n=s.length;
        for(int i=0;i<n-1;i++) {
            if(s[i]>='0' && s[i]<='9') {
                sum += (int)(s[i]-'0') * count;
                count++;
            }
        }
        sum %= 11;
        //判断
        if(sum == s[n-1]-'0' || sum==10 && s[n-1]=='X') {
            System.out.print("Right");
        }else {
            if(sum==10) s[n-1]='X';
            else s[n-1]=(char)(sum+'0');
            for(int i=0;i<n;i++) {
                System.out.print(s[i]);
            }
        }
        //}
    }
}
